package com.fqg.weblucene.web;

import cn.hutool.http.ContentType;
import cn.hutool.http.server.HttpServerRequest;
import cn.hutool.http.server.HttpServerResponse;
import cn.hutool.http.server.action.Action;
import cn.hutool.json.JSONUtil;
import com.fqg.weblucene.lucene.utils.LuceneUtils;

import java.io.IOException;

/**
 * Created by fqg05007 on 2021/9/1.
 */
public class FindAllAction implements Action {
    @Override
    public void doAction(HttpServerRequest httpServerRequest, HttpServerResponse httpServerResponse) throws IOException {
        httpServerResponse.write(JSONUtil.toJsonStr(LuceneUtils.getAllIndexValues()), ContentType.JSON.toString());
    }
}
